<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
 <script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
    <script src="${staticServer}/inc/js/tips.js"></script>
    <script src="${staticServer}/js/web/consultant_client_tracking_list.js?1.0"></script>

<script>
$(function(){
	$("#username").val("<#if inspection??>${inspection.username}</#if>");
	$("#startTime").val("<#if startTime??>${startTime}</#if>");
	$("#endTime").val("<#if endTime??>${endTime}</#if>");
	 $("#center_id").val("<#if inspection??>${inspection.center_id}</#if>");
	 $("#solve_state").val("<#if state??>${state}</#if>");
	
})

	function submit(){
		
		window.location.href="${contextPath}/index/inspectionList.htm?username="+$("#username").val()+"&startTime=" + $("#startTime").val() + "&endTime=" + $("#endTime").val() + "&center_id=" + $("#center_id").val() + "&state=" + $("#solve_state").val();

	}	
	function add_inspection(){
		window.location.href="${contextPath}/index/addInspection.htm";	
	}

</script>
<style type="text/css">
#dianji , #dianji1 {
	display: block;
	float: left;

}
</style>
</head>

<body>
	<div id="home_link">
		<ul>
			<li>竞思教育网络办公系统 v2.0 beta</li>
			<li>&gt;</li>
			<li>工作管理</li>
			<li>&gt;</li>
			<li class="current">巡检列表</li>
		</ul>
	</div>
	<div id="container">
		<div id="title">巡检列表</div>
		
		<table class="simple_table" rel="nohover" style="min-width: 750px;">
			<tbody>
			<tr class="even_row">
				<td>
            
                <label for="phone">巡检中心：</label>
            <select id="center_id">
                <option value="">全部</option>
                <#if offList??>
                    <#list offList as list>
                        <option value="${list.id}">${list.name}</option>
                    </#list>
                </#if>
            <select>
          
                <label for="phone">问题解决情况：</label>
                <select id="solve_state">
                    <option value="">全部</option>
                    <option value="1">已解决</option>
                    <option value="0">未解决</option>
                   
                </select>

                <label for="phone">巡检人：</label>
                <input type="text" value="" id="username"/>

               
                <br/>
                <label for="phone">开始时间：</label>
                <input type="text" id="startTime" rel="DATE::Y-m-d" value="${startTime}" size="15" maxlength="15"
                       readonly="readonly" class="DatePicker_Icon">
                <label for="phone">结束时间：</label>
                <input type="text" id="endTime" rel="DATE::Y-m-d" value="${endTime}" size="15" maxlength="15"
                       readonly="readonly" class="DatePicker_Icon">
            </td>
             <td >
                <input type="button" value=" 查 询 " onclick="submit()"/>
               </td>
               <td >
                <input type="button" value="添加巡检记录" onclick="add_inspection()"/>
               </td>
			</tr>
			</tbody>
		</table>
		
		<table>
			<tr class="fields">
				<th width="170px">中心名称</th>
				<th>巡检人</th>
				<th>更新时间</th>
				<th>巡检时间</th>
				<th>操作</th>
			</tr>
			
			
			<#list list as list>
				<tr class="even_row">
					<td align="center" " style="font-weight: bold;">
					<#if offList??>
						<#list offList as off>
						<#if (off.id == list.center_id)> ${off.name}</#if>	
						</#list>
						</#if>
					</td>
					<td align="center">
					${list.username}		
					</td>
					
					<td align="center">${list.m_date}</td>	
					<td align="center">${list.inspection_time}</td>
					<#if user==list.username>
					<td align="center"> <a href="${contextPath}/index/addInspection.htm?id=${list.id}&state=${state}&isScan=0">编辑</a></td>
					<#else>
					<td align="center"> <a href="${contextPath}/index/addInspection.htm?id=${list.id}&state=${state}&isScan=1">查看</a></td>
					</#if>
				</tr>
			</#list>
			
			
		</table>
	</div>
	<div id="pager" style="width: 820px;">
	<ul id="pagination">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
				<#if currpage==1 >
					<li class="previous-off">上一页</li>
					<#else>
					<li class="previous"><a href="${contextPath}/index/inspectionList.htm?currPage=${currpage-1}&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">上一页</a></li>
					</#if>
					
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/index/inspectionList.htm?currPage=${index_up}&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">${index_up}</a></li>  
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/inspectionList.htm?currPage=${index_up}&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">${index_up}</a></li> 
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/index/inspectionList.htm?currPage=${pagetotal}&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">${pagetotal}</a></li>  
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/index/inspectionList.htm?currPage=1&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">1</a></li>  
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/inspectionList.htm?currPage=${index_up}&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">${index_up}</a></li>  
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/index/inspectionList.htm?currPage=${pagetotal}&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">${pagetotal}</a></li>   
			<#else>
				<li><a href="${contextPath}/index/inspectionList.htm?currPage=1&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">1</a></li> 
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/inspectionList.htm?currPage=${index_up}&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">${index_up}</a></li> 
	           	</#if>
				</#list>  
			</#if>
			
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		<#else>
		
			<li class="previous"><a href="${contextPath}/index/inspectionList.htm?currPage=${currpage+1}&username=${username}&startTime=${startTime}&endTime=${endTime}&center_id=${center_id}&state=${state}">下一页</a></li>
		</#if>
		<li class="pageinfo">共${page.total}条记录</li>
	</#if>
	</ul>
	</div>
	<div class="emptyline clear"></div>
</body>
</html>